<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta charset="UTF-8">
		<!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> -->
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<title></title>
		<link href="css/default.css" rel="stylesheet" type="text/css" />
		<!--必要样式-->
		<link href="css/styles.css" rel="stylesheet" type="text/css" />
		<link href="css/demo.css" rel="stylesheet" type="text/css" />
		<link href="css/loaders.css" rel="stylesheet" type="text/css" />
		<!-- 登录JS -->
		<script type="text/javascript" src="js/BigData/loadjs.js?v=1"></script>
	</head>
	<body>
		<div id="language" style="position: absolute; right: 30px; top: 30px;">
			<img id="cn" title="中文" src="images/cn.gif" onclick="ChangeLanClick(1)" />
			<img id="en" title="English" src="images/en.gif" onclick="ChangeLanClick(2)" />
		</div>
		<div class='login'>
			<div class='login_title'>
				<span datalang="LoginTitle"></span>
			</div>
			<div class='login_fields'>
				<div class='login_fields__user'>
					<div class='icon'>
						<img alt="" src='images/user_icon_copy.png'>
					</div>
					<input name="login" id="login" attrlang="placeholder,User" placeholder='' maxlength="16" type='text' autocomplete="off" value="" />
					<div class='validation'>
						<img alt="" src='images/tick.png'>
					</div>
				</div>
				<div class='login_fields__password'>
					<div class='icon'>
						<img alt="" src='images/lock_icon_copy.png'>
					</div>
					<input name="pwd" id="pwd" attrlang="placeholder,Pwd" placeholder='' maxlength="16" type='password' autocomplete="off">
					<div class='validation'>
						<img alt="" src='images/tick.png'>
					</div>
				</div>
				<div class='login_fields__password'>
					<div class='icon'>
						<img alt="" src='images/key.png'>
					</div>
					<input name="code" attrlang="placeholder,VerificationCode" placeholder='' maxlength="4" type='text' name="ValidateNum" autocomplete="off">
					<div class='validation' style="opacity: 1; right: -5px;top: -3px;">
						<canvas class="J_codeimg" id="myCanvas" onclick="Code();"><label datalang="BrowserNotSupport"></label></canvas>
					</div>
				</div>
				<div class='login_fields__remember'>
					<div class='icon'>
						
					</div>
					<input type="checkbox" name="rememberPwd" id="rememberPwd" title="" value="" checked="checked" />
					<label for="rememberPwd" datalang="RememberAccount"></label>
				</div>
				<div class='login_fields__submit'>
					<input type='button' datalang="Login" value=''>
				</div>
			</div>
			<div class='success'>
			</div>
		</div>
		<div class='authent'>
			<div class="loader" style="height: 44px;width: 44px;margin-left: 28px;">
				<div class="loader-inner ball-clip-rotate-multiple">
					<div></div>
					<div></div>
					<div></div>
				</div>
			</div>
			<p datalang="WaitData"></p>
		</div>
		<div class="OverWindows"></div>

		<link href="layui/css/layui.css" rel="stylesheet" type="text/css" />

		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script type="text/javascript" src="js/jquery-ui.min.js"></script>
		<script type="text/javascript" src='js/stopExecutionOnTimeout.js?t=1'></script>
		<script type="text/javascript" src="layui/layui.js"></script>
		<script type="text/javascript" src="js/Particleground.js"></script>
		<script type="text/javascript" src="js/Treatment.js"></script>
		<script type="text/javascript" src="js/jquery.mockjax.js"></script>
		<script type="text/javascript">
			function ChangeLanClick(iType){
				if (iType == 2) {
					globalSettings["lang"] = "En";
					app.setSettings(globalSettings);
					var sLangJs = "LanZh";
					switch (globalSettings["lang"]) {
						case "Zh":
							sLangJs = "LanZh";
							break;
						case "En":
							sLangJs = "LanEn";
							break;
					}
					loadScript([{
						"path": "js/LanEn.js?t=" + iVersion,
						"type": "js"
					}], function() {
						arrLang = arrLanEn;
						SetCancelAlarm();
						ChangeLan("body", arrLang);
					});
				} else if (iType == 1) {
					globalSettings["lang"] = "Zh";
					app.setSettings(globalSettings);
					loadScript([{
						"path": "js/LanZh.js?t=" + iVersion,
						"type": "js"
					}], function() {
						arrLang = arrLanZHCN;
						SetCancelAlarm();
						ChangeLan("body", arrLang);
					});
				}
			}
			
			var bDocumentComplete = false;
			document.onreadystatechange = function()			
			{ 	
			　　 if(document.readyState == "complete")
			　　 { 
					bDocumentComplete = true;
			   　}
			}
			var timeVersion = (new Date()).getTime();
			
			loadScript([{
				"path": "js/index.js?t=" + timeVersion,
				"type": "js"
			}], LoadMainJs);
			
			function LoadMainJs(){
				LoadMain();
			}
			
			function jsCallback() {
				var loadFun = function(){
					//$('#divVehs').show();
					if (globalSettings["lang"] == "Zh") {
						arrLang = arrLanZHCN;
					} else {
						arrLang = arrLanEn;
					}
					document.title = arrLang.SysTitle;
					SetCancelAlarm();
					ChangeLan("body", arrLang);
					var settings = app.getSettings();
					var appServer = app.getAppIpPort();
					/* $('#ip').val(appServer.ip);
					$('#port').val(appServer.port); */
					var state = app.getState();
					app.setAppIpPort("151.236.34.176", 8083, true);
					app.setAppIpPort("www.gps123.ga", 8083, true);
					if(state.rememberuser){
						$('#login').val(state.account);
						$('#pwd').val(state.pwd);
						$('#rememberPwd')[0].checked = true;
					}
					else{
						$('#login').val("");
						$('#pwd').val("");
						$('#rememberPwd')[0].checked = false;
					}
				}
				if(bDocumentComplete){
					loadFun();
				}
				else{
					$(document).ready(function() {  
						loadFun();
					});
				}
			}
		</script>
		<script type="text/javascript">
			var canGetCookie = 0; //是否支持存储Cookie 0 不支持 1 支持
			var ajaxmockjax = 1; //是否启用虚拟Ajax的请求响 0 不启用  1 启用
			//默认账号密码

			var truelogin = "admin";
			var truepwd = "123456";

			var CodeVal = 0;
			Code();

			function Code() {
				if (canGetCookie == 1) {
					createCode("AdminCode");
					var AdminCode = getCookieValue("AdminCode");
					showCheck(AdminCode);
				} else {
					showCheck(createCode(""));
				}
			}

			function showCheck(a) {
				CodeVal = a;
				var c = document.getElementById("myCanvas");
				var ctx = c.getContext("2d");
				ctx.clearRect(0, 0, 1000, 1000);
				ctx.font = "80px 'Hiragino Sans GB'";
				ctx.fillStyle = "#E8DFE8";
				ctx.fillText(a, 0, 100);
			}
			$(document).keypress(function(e) {
				// 回车键事件  
				if (e.which == 13) {
					$('input[type="button"]').click();
				}
			});
			//粒子背景特效
			$('body').particleground({
				dotColor: '#E8DFE8',
				lineColor: '#133b88'
			});
			$('input[name="pwd"]').focus(function() {
				$(this).attr('type', 'password');
			});
			$('input[type="text"]').focus(function() {
				$(this).prev().animate({
					'opacity': '1'
				}, 200);
			});
			$('input[type="text"],input[type="password"]').blur(function() {
				$(this).prev().animate({
					'opacity': '.5'
				}, 200);
			});
			$('input[name="login"],input[name="pwd"]').keyup(function() {
				var Len = $(this).val().length;
				if (!$(this).val() == '' && Len >= 5) {
					$(this).next().animate({
						'opacity': '1',
						'right': '30'
					}, 200);
				} else {
					$(this).next().animate({
						'opacity': '0',
						'right': '20'
					}, 200);
				}
			});
			var open = 0;
			layui.use(['form','layer'], function() {
				/* var msgalert = '默认账号:' + truelogin + '<br/> 默认密码:' + truepwd;
    		var index = layer.alert(msgalert, { icon: 6, time: 4000, offset: 't', closeBtn: 0, title: '友情提示', btn: [], anim: 2, shade: 0 });  
			layer.style(index, {
				color: '#777'
			}); */
				//非空验证
				$('input[type="button"]').click(function() {
					var login = $('input[name="login"]').val();
					var pwd = $('input[name="pwd"]').val();
					var code = $('input[name="code"]').val();
					if (login == '') {
						ErroAlert(arrLang.PleaseInputUser);
					} else if (pwd == '') {
						ErroAlert(arrLang.PleaseInputPwd);
					} else if (code == '' || code.length != 4 || code.toUpperCase() != CodeVal.toUpperCase()) {
						ErroAlert(arrLang.PleaseInputVerificationCode);
					} else {
						//认证中..
						//fullscreen();
						$('.login').addClass('test'); //倾斜特效
						setTimeout(function() {
							$('.login').addClass('testtwo'); //平移特效
						}, 300);
						setTimeout(function() {
							$('.authent').show().animate({
								right: -320
							}, {
								easing: 'easeOutQuint',
								duration: 600,
								queue: false
							});
							$('.authent').animate({
								opacity: 1
							}, {
								duration: 200,
								queue: false
							}).addClass('visible');
						}, 500);
						var settings = app.getSettings();
						//登录
						var JsonData = {
							account: login,
							password: pwd,
							code: code,
							usertype: 1,
							rememberuser: $('#rememberPwd')[0].checked // settings.rememberAccount
						};
						//此处做为ajax内部判断
						var url = "";
						if (JsonData.account == truelogin && JsonData.password == truepwd && JsonData.code.toUpperCase() == CodeVal.toUpperCase()) {
							url = "Ajax/Login";
						} else {
							url = "Ajax/LoginFalse";
						}
						app.login(JsonData, function(result, err, data) {
							//认证完成
							setTimeout(function() {
								$('.authent').show().animate({
									right: 90
								}, {
									easing: 'easeOutQuint',
									duration: 600,
									queue: false
								});
								$('.authent').animate({
									opacity: 0
								}, {
									duration: 200,
									queue: false
								}).addClass('visible');
								$('.login').removeClass('testtwo'); //平移特效
							}, 1000);
							setTimeout(function() {
								$('.authent').hide();
								$('.login').removeClass('test');
							}, 1400);
							if (!result) {
								switch (err) {
									case "ErrUserLength":
										err = arrLang.ErrUserLength;
										break;
									case "ErrUserPwdLength":
										err = arrLang.ErrUserPwdLength;
										break;
									case "ErrUserWrong":
										err = arrLang.ErrUserWrong;
										break;
								}
								AjaxErro(err);
								return;
							}
							$('.login div').fadeOut(100);
							$('.success').fadeIn(1000);
							$('.success').html(arrLang.Successful);
							location.href = 'index.html';
							/* mui.hideLoading();
							sGlobalPwd = $.trim(passwordBox.value);
							sGlobalUserName = $.trim(accountBox.value);
							sGlobalUserType = loginInfo.usertype;
							$('#divLogin').hide();
							state = app.getState();
							sGlobalToken = state.token;
							mui.showLoading(arrLang["LoadingData"], "div");
							GetAllData(); */
						});
						/* AjaxPost(url, JsonData,
							function() {
								//ajax加载中
							},
							function(data) {
								//ajax返回 
								//认证完成
								setTimeout(function() {
									$('.authent').show().animate({
										right: 90
									}, {
										easing: 'easeOutQuint',
										duration: 600,
										queue: false
									});
									$('.authent').animate({
										opacity: 0
									}, {
										duration: 200,
										queue: false
									}).addClass('visible');
									$('.login').removeClass('testtwo'); //平移特效
								}, 2000);
								setTimeout(function() {
									$('.authent').hide();
									$('.login').removeClass('test');
									if (data.Status == 'ok') {
										//登录成功
										$('.login div').fadeOut(100);
										$('.success').fadeIn(1000);
										$('.success').html(arrLang.Successful);
										//跳转操作

									} else {
										AjaxErro(data);
									}
								}, 2400);
							}) */
					}
				})
			})
			var fullscreen = function() {
				elem = document.body;
				if (elem.webkitRequestFullScreen) {
					elem.webkitRequestFullScreen();
				} else if (elem.mozRequestFullScreen) {
					elem.mozRequestFullScreen();
				} else if (elem.requestFullScreen) {
					elem.requestFullscreen();
				} else {
					//浏览器不支持全屏API或已被禁用  
				}
			}
			if (ajaxmockjax == 1) {
				$.mockjax({
					url: 'Ajax/Login',
					status: 200,
					responseTime: 50,
					responseText: {
						"Status": "ok",
						"Text": "登录成功<br /><br />欢迎回来"
					}
				});
				$.mockjax({
					url: 'Ajax/LoginFalse',
					status: 200,
					responseTime: 50,
					responseText: {
						"Status": "Erro",
						"Erro": "账号名或密码或验证码有误"
					}
				});
			}
		</script>

	</body>
</html>
